<?php

class PresentationController extends GTL_Action {

    public function init() {
        parent::init();
        /* Initialize action controller here */
        
        $layout = $this->_helper->layout();
        $layout->setLayout('meeting-layout');
    }

    public function indexAction() {

        $showTemplate = false;
        $templateMessage = '';
        $meetingName = '';
        $hashtag = '';

        //Check for the url id Parameter
        if ($this->_getParam('hashtag') && $this->_getParam('hashtag') != "") {
            $hashtag = $this->_getParam('hashtag');

            $urlModel = new Model_Url();
            $urlData = $urlModel->fetchUrls("url_hashtag = '" . $hashtag . "' and url_status = '1'");
            if ($urlData) {
                $showTemplate = true;
                $meetingName = $urlData['0']['url_name'];
                $hashtag = $urlData['0']['url_hashtag'];
            } else {
                $showTemplate = false;
                $templateMessage = "Sorry! But this Custom URL is no more active";
            }
        } else {
            $showTemplate = false;
            $templateMessage = "Sorry! But no such Custom URL available";
        }

        $this->view->hashtag = $hashtag;
        $this->view->meetingName = $meetingName;
        $this->view->templateMessage = $templateMessage;
        $this->view->showTemplate = $showTemplate;
    }

}

?>
